<?php


namespace app\api\controller\points_mall;

use app\api\controller\xyb\Base;
use app\api\service\Activity\AssociationService;
use app\api\service\UsersService;

class Index extends Base
{
    protected $noNeedLogin = ['*'];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    public function index()
    {
        // 获取当前已认证的用户信息
        $users = $this->getAuthUsers();
        $user_circle = UsersService::formatUsersCircleStatusInfo($users->id, $users->circle_id);

        // 调用AssociationService方法，获取用户参与的社团列表
        $res = AssociationService::getUsersParticipateAssociationLists($users->id, $user_circle['circle_id']);

        // 返回成功响应及社团列表数据
        $this->success('请求成功', $res);
    }
}